/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package doghost.utils;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import javax.swing.table.DefaultTableCellRenderer;

/**
 *
 * @author duo
 */
public class CustomTimestampRenderer extends DefaultTableCellRenderer {
    
    protected DateFormat formatter;

    public CustomTimestampRenderer() {
        super();
    }
    
    @Override
    public void setValue(Object value) {
        if (formatter == null) {
            formatter = new SimpleDateFormat("dd/MM/yyyy HH:mm");
        }
        setText(value==null ? "" : formatter.format(value));
    }

}
